<template>
    <!--为echarts准备一个具备大小的容器dom-->
    <div id="main" style="width: 1500px;height: 700px;"></div>
</template>
<script>
    import echarts from 'echarts'
    export default {
        name: 'PaperMonth',
        methods:{
            drawPie(id){
                this.charts = echarts.init(document.getElementById(id))
                this.charts.setOption({
                    title: {
                        text: '每月文章统计   (万篇/日期）'
                    },
                    xAxis: {
                        type: 'category'
                    },
                    legend: {
                    },
                    yAxis: {},
                    series: [{
                        symbolSize: 20,
                        data: [
                            [1, 8.04],
                            [3, 6.95],
                            [5, 7.58],
                            [7, 8.81],
                            [9, 8.33],
                            [11, 9.96],
                            [13, 7.24],
                            [17, 4.26],
                            [19, 10.84],
                            [21, 4.82],
                            [23, 5.68],
                            [25, 4.26],
                            [27, 10.84],
                            [29, 4.82],
                            [31, 5.68]
                        ],
                        type: 'scatter'
                    }]
                })
            }
        },
        //调用
        mounted(){
            this.$nextTick(function() {
                this.drawPie('main')
            })
        }
    }
</script>
<style scoped>
    * {
        margin: 0;
        padding: 0;
        list-style: none;
    }
</style>
